public class Zuoye2 {
    public static int add(int a,int...b) {
        int sum = a;
        for (int e:b)
            sum += e;
        return sum;
    }
    public static int Add(int[] array) {
        int sum1 = 0;
        for (int i = 0; i < array.length; i++) {
            sum1 += array[i];
        }
        return sum1;
    }
    public static void main(String[] args) {
        System.out.println("3+4="+add(3,4));
        System.out.println("3+4+5+6="+add(3,4,5,6));
        int[] array = {8,9,10,11,18,21,33};
        int Sum = 10+Add(array);
        System.out.println("Sum="+10+Add(array));
        System.out.println("Sum="+add(10,array));
    }
}
